package com.stupro.cjlu.manager;


import com.stupro.cjlu.dao.TeacherDAO;
import com.stupro.cjlu.entity.Teacher;
import org.springframework.stereotype.Component;

@Component
public class TeacherManager extends BaseManager{
    private TeacherDAO teacherDAO;

    public TeacherManager(TeacherDAO teacherDAO) {
        this.teacherDAO = teacherDAO;
    }

    public Integer getPageCount(String name) {
        int count = teacherDAO.count(name);
        return count;
    }

    public Teacher get(Integer id) {
        return teacherDAO.get(id);
    }

    public int create(Teacher entity) {
        return teacherDAO.insert(entity);
    }
}
